@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-offset-2">
                <div class="page-header">
                    <h1>


                        <avatar-form :user="{{ $profileUser }}"></avatar-form>
                        {{--
                         {{ $profileUser->name }}
                         @can('update',$profileUser)
                            <form method="POST" action="{{ route('avatar',$profileUser) }}" enctype="multipart/form-data">

                                {{ csrf_field() }}

                                <input type="file" name="avatar">

                                <button type="submit" class="btn btn-primary">Add Avatar</button>

                            </form>
                        @endcan

                        <img src="/storage/{{ $profileUser->avatar() }}" width="200" height="200">--}}

                        {{--<small>注册于{{ $profileUser->created_at->diffForHumans() }}</small>--}}
                    </h1>
                </div>

                @forelse($activities as $date => $activity)
                    <h3 class="page-header">{{ $date }}</h3>

                    @foreach($activity as $record)
                        @if(view()->exists("profiles.activities.{$record->type}"))
                            @include("profiles.activities.{$record->type}",['activity'  => $record])
                        @endif
                    @endforeach
                @empty
                    <p>There is no activity for this user yet.</p>
                @endforelse
                {{--@foreach($threads as $thread)
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="level">
                        <span class="flex">
                            <a href="{{ route('profile',$thread->creator) }}">{{ $thread->creator->name }}</a> 发表于
                            <a href="{{ $thread->path() }}">{{ $thread->title }}</a>
                        </span>

                                <span>{{ $thread->created_at->diffForHumans() }}</span>
                            </div>
                        </div>

                        <div class="panel-body">
                            {{ $thread->body }}
                        </div>
                    </div>
                @endforeach
                {{ $threads->links() }}--}}
            </div>
        </div>
    </div>
@endsection